package org.springcloud.wisdom.amusement.login.loginmsg.controller;

import org.springcloud.wisdom.amusement.bean.ResponseData;
import org.springcloud.wisdom.amusement.login.loginmsg.entity.Student;
import org.springcloud.wisdom.amusement.login.loginmsg.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/sys/funstudent")
public class StudentController extends BaseController {
    @Autowired
    IStudentService studentService;

    //获取学生分页信息
    @GetMapping("gets")
    public ResponseData<Object> getAStudent(int currentPage, int size) {
        return returnObject2(studentService.getStudentPage(currentPage, size));
    }
    //获取学生信息
    @GetMapping("gets1")
    public ResponseData<Object> getStudentPage(String sid) {
        return returnObject2(studentService.getAStudent(sid));
    }
    //更新学生信息
    @PutMapping("update")
    public ResponseData<Boolean> updateStudent(@RequestBody Student student) {
        return returnBoolean(studentService.updateStudent(student));
    }
}
